<script setup lang="ts">
const props = defineProps({
  newsobj: Object,
})
defineEmits<{ (e: 'detail', id: string): void }>()
</script>

<template>
  <div cursor="pointer" p="4" lt-lg="!p-0" flex="~ row gap-4 " @click="$emit('detail', newsobj?.newsId)">
    <div min-w="180px" lt-lg:min-w="100px" flex="shrink-1 basis-180px" class="flex items-center justify-center">
      <img w-full object="contain" :src="newsobj.imgUrl ? getAssetUrl(newsobj.imgUrl) : 'https://30850783.s21i.faiusr.com/2/ABUIABACGAAg_YzJowYohpyj1gQwgAg4qgU!700x700.jpg.webp'">
    </div>
    <div flex="~  col justify-between ">
      <div>
        <div text="18px" lt-lg:text="14px" mb-4 font-500 lt-lg:mb-1>
          <n-ellipsis>{{ newsobj.title }}</n-ellipsis>
        </div>
        <div text="14px" lt-lg:text="12px">
          {{ newsobj.publishTime }}
        </div>
      </div>
      <div text="14px" lt-lg:text="12px">
        <n-ellipsis
          :line-clamp="2" :tooltip="{
            contentStyle: {
              maxWidth: '50vw',
            },
          }"
        >
          {{ newsobj.disContent }}
        </n-ellipsis>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>

</style>
